﻿using System;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApp5
{
    class 抽象类
    {
        public 抽象类()
        {
            DriveClass driveClass = new DriveClass();
            driveClass.Show();
            MyClass myClass = driveClass;   // 不能直接new MyClass()
            myClass.Show();
        }
    }
    public abstract class MyClass
    {
        public abstract void Show();        // 抽象内中无法实现该函数，虚方法中可以
    }
    public class DriveClass : MyClass
    {
        public override void Show()
        {
            //throw new NotImplementedException();
            Console.WriteLine("DriveClass");
        }
    }
}
